<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<script type="text/javascript">
	$(function() {
		$("#userRemand_list tr:gt(0)").click(function() {
			if ($(this).find(":radio").attr("checked") == "checked") {
				$(this).find(":radio").attr("checked", false);
			} else {
				$(this).find(":radio").attr("checked", true);
			}

		});
	});
</script>
<!-- 顶部模块[如：功能按钮、搜索面板] -->
<div class="bjui-pageHeader" style="background: #FFF;">
	<form id="pagerForm" data-toggle="ajaxsearch"
		action="${ctx}/bus/merchantBidAction/doList" method="post">
		<input type="hidden" name="pageSize" value="${pageResult.pageSize}">
		<input type="hidden" name="pageCurrent"
			value="${pageResult.pageCurrent}"> <input type="hidden"
			name="orderField" value="${pageResult.orderField}"> <input
			type="hidden" name="orderDirection"
			value="${pageResult.orderDirection}">
		<div style="margin-top: 5px;">
			<!-- 刷新按钮-->
			<button class="btn btn-orange" data-icon="refresh">刷新</button>
			<!-- 添加按钮-->
			<%-- <shiro:hasPermission name="advertisementAdd">
		   	<a href="${ctx}/bus/passBasDiscoveryAction/toAdd" class="btn btn-green" data-icon="plus" data-toggle="dialog" data-max=true data-id="dialog-user" data-mask="true">添加</a>
		   	</shiro:hasPermission> --%>
			<!-- 编辑按钮-->
			<%-- 	<shiro:hasPermission name="advertisementEdit">
		   	<a href="${ctx}/bus/passBasDiscoveryAction/toEdit?id={#bjui-selected}" class="btn btn-blue" data-icon="edit" data-toggle="dialog" data-max=true data-id="dialog-user" data-mask="true">编辑</a>
		   	</shiro:hasPermission> --%>
			<!-- 删除按钮-->
			<%--   	<shiro:hasPermission name="advertisementDel">
		   	<a href="${ctx}/bus/passBasDiscoveryAction/doDel?id={#bjui-selected}" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要删除选中记录吗？" data-icon="remove">删除</a>
		   	</shiro:hasPermission> --%>
		</div>
		<hr style="margin-top: 5px; margin-bottom: 5px">
		<div style="margin-bottom: 5px">
			<label>出发城市：<input id="paramTitle" type="text"
				name="paramStartCity" value="${pageResult.ext.paramStartCity}"
				placeholder="请输入出发城市" style="width: 140px;" /></label> <label>目的城市：<input
				id="paramTitle" type="text" name="paramEndCity"
				value="${pageResult.ext.paramEndCity}" placeholder="请输入目的城市"
				style="width: 140px;" /></label>
			<%-- <label>关键词：<input id="paramKeyWords" type="text" name="paramKeyWords" value="${pageResult.ext.paramKeyWords}" placeholder="请输入关键词"  style="width:140px;"/></label> --%>
			<label>航程类型： <select id="paramFlightType"
				name="paramFlightType" data-toggle="selectpicker">
					<c:forEach items="${flightType}" var="c">
							<c:choose>
							<c:when test="${ pageResult.ext.paramFlightType==c.codeValue}">
								<option value="${pageResult.ext.paramFlightType}"
									selected="selected">${c.codeName}</option>
							</c:when>
							<c:when test="${c.codeName=='不限'}">
								<option value="" selected="selected">${c.codeName}</option>
							</c:when>
							<c:otherwise>
								<option value="${c.codeValue}">${c.codeName}</option>
							</c:otherwise>
						</c:choose>
					</c:forEach>
			</select>
			</label>
			<label>商品类型： <select id="paramGoodsType"
				name="paramGoodsType" data-toggle="selectpicker">
					<c:forEach items="${goodsType}" var="c">
							<c:choose>
							<c:when test="${ pageResult.ext.paramGoodsType==c.codeValue}">
								<option value="${pageResult.ext.paramGoodsType}"
									selected="selected">${c.codeName}</option>
							</c:when>
							<c:when test="${c.codeName=='不限'}">
								<option value="" selected="selected">${c.codeName}</option>
							</c:when>
							<c:otherwise>
								<option value="${c.codeValue}">${c.codeName}</option>
							</c:otherwise>
						</c:choose>
					</c:forEach>
			</select>
			</label>
			<button class="btn-default" data-icon="search">查询</button>
		</div>
	</form>
</div>
<!-- 内容区 -->
<div class="bjui-pageContent tableContent" id="userRemand_list">
	<table id="doc-datagrid-table"
		class="table table-bordered table-hover table-striped table-top">
		<thead>
			<tr style="height: 30px;">
				<th>状态</th>
				<th>用户名称</th>
				<th>竞标商户数量</th>
				<th>航班类型</th>
				<th>商品类型</th>
				<th>去程开始时间</th>
				<th>去程结束时间</th>
				<th>返程开始时间</th>
				<th>返程结束时间</th>
				<th>状态</th>
				<th>详情</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${pageResult.list}" var="u" varStatus="status">
				<tr data-id="${u.id}">
					<td><input name="userRemand_list" type="radio" /></td>
					<td>${u.demandCustomerName}</td>
					<td>${u.merchantCount}</td>
					<td>${u.flightTypeName}</td>
					<td>${u.goodsTypeName}</td>				
					<td><fmt:formatDate type="both" pattern="yyyy-MM-dd" value="${u.goStartTime}" /></td>
					<td><fmt:formatDate type="both" pattern="yyyy-MM-dd" value="${u.goEndTime}" /></td>
					<td><fmt:formatDate type="both" pattern="yyyy-MM-dd" value="${u.returnStartTime}" /></td>
					<td><fmt:formatDate type="both" pattern="yyyy-MM-dd" value="${u.returnEndTime}" /></td>
					<td>${u.demandStatusName}</td>
					<td>
						<button type="button" class="btn btn-default" data-toggle="dialog"
							data-options="{id:'demandBid',url:'${ctx}/bus/merchantBidAction/toDetails',type:'post',data:{id:${u.id}}}"
							data-width="900" data-height="600" data-id="dialog-user-role"
							data-title="需求明细">详情</button>
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
</div>
<!-- 底部模块[如：工具条、分页组件]  -->
<div class="bjui-pageFooter">
	<div class="pages">
		<span>每页 </span>
		<div class="selectPagesize">
			<select data-toggle="selectpicker"
				data-toggle-change="changepagesize">
				<option value="10">10</option>
				<option value="30">30</option>
				<option value="60">60</option>
				<option value="100">100</option>
			</select>
		</div>
		<span> 条，共 ${pageResult.total} 条</span>
	</div>
	<div class="pagination-box" data-toggle="pagination"
		data-total="${pageResult.total}"
		data-page-size="${pageResult.pageSize}"
		data-page-current="${pageResult.pageCurrent}"></div>
</div>